class Goods {
    constructor() {
        this.data  = [
            { id: 1, name: 'Xiaomi 15S Pro', imgUrl: '/img/1.png', group: '手机' },
            { id: 2, name: 'Xiaomi Civi 5 Pro', imgUrl: '/img/2.png', group: '手机' },
            { id: 3, name: 'REDMI Turbo 4 Pro', imgUrl: '/img/3.png', group: '手机' },
            { id: 4, name: 'Xiaomi 15 Ultra', imgUrl: '/img/4.png', group: '手机' },
            { id: 5, name: 'REDMI Turbo 4', imgUrl: '/img/5.png', group: '手机' },
            { id: 6, name: 'Redmi 14C', imgUrl: '/img/6.png', group: '手机' },
            { id: 7, name: 'REDMI K80 Pro', imgUrl: '/img/7.png', group: '手机' },
            { id: 8, name: 'REDMI K80', imgUrl: '/img/8.png', group: '手机' },
            { id: 9, name: 'Xiaomi Buds 5 Pro', imgUrl: '/img/9.png', group: '智能穿戴' },
            { id: 10, name: 'REDMI Buds 6 Pro', imgUrl: '/img/10.png', group: '智能穿戴' },
            { id: 11, name: 'Redmi Buds 6 青春版', imgUrl: '/img/11.png', group: '智能穿戴' },
            { id: 12, name: 'Redmi Buds 6', imgUrl: '/img/12.png', group: '智能穿戴' },
            { id: 13, name: 'Xiaomi Buds 5', imgUrl: '/img/13.png', group: '智能穿戴' },
            { id: 14, name: 'Redmi Buds 6S', imgUrl: '/img/14.png', group: '智能穿戴' },
            { id: 15, name: 'Redmi Buds 6 活力版', imgUrl: '/img/15.png', group: '智能穿戴' },
            { id: 16, name: 'Xiaomi 开放式耳机', imgUrl: '/img/16.png', group: '智能穿戴' },
            { id: 17, name: 'Xiaomi Pad 7 Ultra', imgUrl: '/img/17.png', group: '笔记本 | 平板' },
            { id: 18, name: 'Xiaomi Pad 7 Pro', imgUrl: '/img/18.png', group: '笔记本 | 平板' },
            { id: 19, name: 'Xiaomi Pad 7', imgUrl: '/img/19.png', group: '笔记本 | 平板' },
            { id: 20, name: 'Redmi Pad Pro系列', imgUrl: '/img/20.png', group: '笔记本 | 平板' },
            { id: 21, name: 'REDMI Book Pro 16 2025', imgUrl: '/img/21.png', group: '笔记本 | 平板' },
            { id: 22, name: 'REDMI Book 14 锐龙版 2025', imgUrl: '/img/22.png', group: '笔记本 | 平板' },
            { id: 23, name: 'REDMI Book 16 2025', imgUrl: '/img/23.png', group: '笔记本 | 平板' },
            { id: 24, name: 'REDMI Book 14 2025', imgUrl: '/img/24.png', group: '笔记本 | 平板' },
            { id: 25, name: '小米电视S Pro Mini LED系列', imgUrl: '/img/25.png', group: '家电' },
            { id: 26, name: '小米电视 S Mini LED 系列', imgUrl: '/img/26.png', group: '家电' },
            { id: 27, name: 'Redmi 智能电视 X 2025款', imgUrl: '/img/27.png', group: '家电' },
            { id: 28, name: '巨省电Pro 1.5匹超一级能效 米家空调', imgUrl: '/img/28.png', group: '家电' },
            { id: 29, name: '巨省电 小米空调 1.5匹新1级能效', imgUrl: '/img/29.png', group: '家电' },
            { id: 30, name: '巨省电Pro 立式3匹 超一级能效 米家空调', imgUrl: '/img/30.png', group: '家电' },
            { id: 31, name: '巨省电 立式3匹新一级能效 米家空调', imgUrl: '/img/31.png', group: '家电' },
            { id: 32, name: '米家电烤箱', imgUrl: '/img/32.png', group: '家电' },
            { id: 33, name: '米家智能直流变频落地扇1X 升级版', imgUrl: '/img/33.png', group: '生活电器' },
            { id: 34, name: '米家循环扇', imgUrl: '/img/34.png', group: '生活电器' },
            { id: 35, name: '米家直流变频落地扇 Pro', imgUrl: '/img/35.png', group: '生活电器' },
            { id: 36, name: '米家落地扇', imgUrl: '/img/36.png', group: '生活电器' },
            { id: 37, name: '米家智能直流变频循环扇 落地式', imgUrl: '/img/37.png', group: '生活电器' },
            { id: 38, name: '米家智能直流变频塔扇2', imgUrl: '/img/38.png', group: '生活电器' },
            { id: 39, name: '米家桌面移动风扇', imgUrl: '/img/39.png', group: '生活电器' },
            { id: 40, name: '米家直流变频台式循环扇', imgUrl: '/img/40.png', group: '生活电器' },
            { id: 41, name: '米家前置过滤器', imgUrl: '/img/41.png', group: '厨房电器' },
            { id: 42, name: '米家即热管线机', imgUrl: '/img/42.png', group: '厨房电器' },
            { id: 43, name: '米家即热净水器Q1000', imgUrl: '/img/43.png', group: '厨房电器' },
            { id: 44, name: '米家净水器1000G', imgUrl: '/img/44.png', group: '厨房电器' },
            { id: 45, name: '米家净水器1000G Pro', imgUrl: '/img/45.png', group: '厨房电器' },
            { id: 46, name: '米家净水器 1200G Pro', imgUrl: '/img/46.png', group: '厨房电器' },
            { id: 47, name: '米家双核净水器 1200G Pro', imgUrl: '/img/47.png', group: '厨房电器' },
            { id: 48, name: '米家净水器1600G', imgUrl: '/img/48.png', group: '厨房电器' },
            { id: 49, name: 'Xiaomi 智能音箱 Pro', imgUrl: '/img/49.png', group: '智能家居' },
            { id: 50, name: 'Xiaomi 智能音箱', imgUrl: '/img/50.png', group: '智能家居' },
            { id: 51, name: 'Xiaomi智能家庭屏Pro 8', imgUrl: '/img/51.png', group: '智能家居' },
            { id: 52, name: 'Xiaomi智能家庭屏 10', imgUrl: '/img/52.png', group: '智能家居' },
            { id: 53, name: 'Xiaomi Sound Pro', imgUrl: '/img/53.png', group: '智能家居' },
            { id: 54, name: '小米小爱音箱Play 增强版', imgUrl: '/img/54.png', group: '智能家居' },
            { id: 55, name: 'Xiaomi 智能家庭屏 Mini', imgUrl: '/img/55.png', group: '智能家居' },
            { id: 56, name: 'Redmi小爱触屏音箱 8英寸', imgUrl: '/img/56.png', group: '智能家居' }
        ];
    }

    async getAllGoods() {
       return this.data;
    }

    async getGoods(id) {
        for (let i = 0; i < this.data.length; i++) {
            if (this.data[i].id == id) {
                return { success: true, data: this.data[i] };
            }
        }
        return { success: false };
    }
}

const goods = new Goods();

module.exports = goods;
